package 开始的剑指offer8月.动态规划;
// https://leetcode-cn.com/problems/gu-piao-de-zui-da-li-run-lcof/
public class 剑指Offer63股票的最大利润0820 {
    public class Solution {
        public int maxProfit(int prices[]) {
            int maxprofit = 0;
            for (int i = 0; i < prices.length - 1; i++) {
                for (int j = i + 1; j < prices.length; j++) {
                    int profit = prices[j] - prices[i];
                    if (profit > maxprofit) {
                        maxprofit = profit;
                    }
                }
            }
            return maxprofit;
        }
    }

}
